layui.use(['layer'],function() {
    var layer = parent.layer === undefined ? layui.layer : top.layer;

    //验证当前用户是否登录
    var _ticket = $.cookie("token");
    if(_ticket != null || _ticket != ""){
        $.ajax({
            url : "http://localhost:8083/user/token/" + _ticket,//单点登录链接
            dataType : "jsonp",
            type : "GET",
            success : function(data){
                if (data.code != 200) {
                    layer.confirm('用户登录已过期，请中重新登录', {icon: 3, title: '提示信息'}, function (tips) {});
                    window.location.href = "http://localhost:8083/login";
                }
            }
        });
    } else {
        layer.confirm('用户登录已过期，请中重新登录', {icon: 3, title: '提示信息'}, function (tips) {});
        window.location.href = "http://localhost:8083/login";
    }

});

